import { useState } from 'react'
import { createGlobalStore } from 'hox'
export const [useCountStore, getCountStore] = createGlobalStore(() => {
    const [conut, setCount] = useState<number>(0)
  
    function addCount(num:number) {
        setCount(conut+num)
    }
  
    function finishCount() {
        setCount(0)
    }
  
    return {
        conut,
        addCount,
        finishCount,
    }
  })